<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" th:href="@{/assets/css/colorbox.css}"/>
<link rel="stylesheet" type="text/css" th:href="@{/My97DatePicker/skin/WdatePicker.css}"/>
<head th:include="fragments/head::header"/>
<body>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <div class="main-content">

            <div class="page-content">
                <h3 class="header smaller lighter blue">定校信息</h3>
                <br/>
                <input type="hidden" name="apply.id" id="id" th:value="${apply.apply.id}"/>
                <input type="hidden" name="apply.studentNo" id="studentNo" th:value="${apply.apply.studentNo}"/>
                <input type="hidden" id="planId" th:value="${planId}"/>
                <input type="hidden" id="planCollegeId" th:value="${planCollegeId}"/>
                <input type="hidden" id="copy" th:value="${apply.apply.collegeCopy}"/>
                <input type="hidden" id="material" th:value="${apply.apply.collegeMaterial}"/>
                <input type="hidden" id="lodVisaOnSchool" th:value="${lodVisaOnSchool}"/>
                <input type="hidden" id="nation" th:value="${nation}"/>
                <div class="tab-pane fade in active">
                    <div class="container">
                        <div class="form-horizontal">
                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue"> 申请类型：</label>
                                <select disabled="disabled" class="col-sm-2 input-sm" id="applyType"
                                        name="apply.applyType">
                                    <option value="1" th:selected="${apply!=null}? ${apply.apply.applyType==1}">主课申请
                                    </option>
                                    <option value="2" th:selected="${apply!=null}? ${apply.apply.applyType==2}">语言申请
                                    </option>
                                </select>
                                <label class="col-sm-2 control-label no-padding-right blue"> 申请院校：</label>
                                <input readonly="readonly" class="col-sm-2" id="collegeName" name="apply.collegeName"
                                       th:value="${apply.apply!=null}? ${apply.apply.collegeName}" required="required"/>
                            </div>
                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue" for="majorName">
                                    申请专业：</label>
                                <input readonly="readonly" class="col-sm-2" id="majorName" name="apply.majorName"
                                       th:value="${apply.apply!=null}?  ${apply.apply.majorName}" required="required"/>
                                <!--<label class="col-sm-2 control-label no-padding-right blue" for="collegeNo"> 申请院校编号：</label>
                                <input readonly="readonly" class="col-sm-2" name="apply.collegeNo" th:value="${apply.apply!=null}? ${apply.apply.collegeNo}" required="required"/>-->
                                <label class="col-sm-2 control-label no-padding-right blue"
                                       for="courseName">课程名称：</label>
                                <input readonly="readonly" class="col-sm-2" id="courseName" name="apply.courseName"
                                       th:value="${apply.apply!=null}?  ${apply.apply.courseName}" required="required"/>

                            </div>

                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue" for="schoolLength">
                                    学制：</label>
                                <input readonly="readonly" class="col-sm-2" id="schoolLength" name="apply.schoolLength"
                                       th:value="${apply.apply!=null}? ${apply.apply.schoolLength}"/>
                                <label class="col-sm-2 control-label no-padding-right blue" for=""> 开课日期：</label>

                                <input readonly="readonly" style="width: 190px"
                                       id="courseStartTime" name="apply.courseStartTime"
                                       th:value="${apply.apply.courseStartTime!=null}? ${#dates.format(apply.apply.courseStartTime, 'yyyy-MM-dd')}"/>

                            </div>

                        </div>
                    </div>
                </div>
                <h3 class="header smaller lighter blue">申请信息</h3>
                <div class="tab-pane fade in active">
                    <div class="container">
                        <div class="form-horizontal">
                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue"> 申请方式：</label>
                                <select disabled="disabled" class="col-sm-2 input-sm" id="applyWay"
                                        name="apply.applyWay">
                                    <option value="1" th:selected="${apply.apply!=null}? ${apply.apply.applyWay==1}">
                                        邮寄
                                    </option>
                                    <option value="2" th:selected="${apply.apply!=null}? ${apply.apply.applyWay==2}">
                                        网申
                                    </option>
                                    <option value="3" th:selected="${apply.apply!=null}? ${apply.apply.applyWay==3}">
                                        邮件
                                    </option>
                                </select>
                                <label class="col-sm-2 control-label no-padding-right blue"> 申请提交日期：</label>
                                <input readonly="readonly" style="width: 190px"
                                       id="commitDate" name="apply.commitDate"
                                       th:value="${apply.apply.commitDate!=null}? ${#dates.format(apply.apply.commitDate, 'yyyy-MM-dd HH:mm:ss')}"/>
                            </div>
                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue"> 审理周期：</label>
                                <input readonly="readonly" class="col-sm-2" type="number" min="1" max="2000"
                                       id="replyCycle" name="apply.replyCycle"
                                       th:value="${apply.apply!=null}? ${apply.apply.replyCycle}"/> &nbsp;&nbsp;天
                            </div>
                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue"> 文书内容：</label>
                                <div class="copy-show">
                                    <a th:href="${apply.apply!=null}? ${apply.apply.collegeCopy}" target="_blank">查看</a>
                                    <!--<a    th:href="${apply.apply!=null}? ${apply.apply.collegeCopy}" target="_blank" download="下载" >下载</a>-->
                                </div>
                            </div>
                            <div class="form-group" style="height:29px">
                                <label class="col-sm-2 control-label no-padding-right blue"> 申请材料：</label>
                                <div class="material-show">
                                    <a th:href="${apply.apply!=null}? ${apply.apply.collegeMaterial}"
                                       target="_blank">查看</a>
                                    <!--<a    th:href="${apply.apply!=null}? ${apply.apply.collegeMaterial}" target="_blank" download="">下载</a>-->
                                </div>
                            </div>
                        </div>
                    </div>


                    <h3 class="header smaller lighter blue send">寄件信息</h3>
                    <div class="tab-pane fade in active send">
                        <div class="container">
                            <div class="form-horizontal">
                                <div class="form-group" style="height:29px">
                                    <label class="col-sm-2 control-label no-padding-right blue"> 快递公司：</label>

                                    <select type="" class="col-sm-3 form-control input-sm" id="expressCompanyCode"
                                            name="expressCompanyCode" style="width:190px;height:25px;"
                                            required="required">
                                        <option value="" selected="selected">请选择</option>
                                        <option th:each="express:${apply.expressCompanyList}"
                                                th:value="${express.companyCode}"
                                                th:selected="${apply.supplementInfo}? ${express.companyCode==apply.supplementInfo.expressCompanyCode}"
                                                th:text="${express.companyName}"></option>
                                    </select>
                                    <label class="col-sm-2 control-label no-padding-right blue"> 快递单号：</label>
                                    <input readonly="readonly" class="col-sm-3" style="width: 190px" id="expressNo"
                                           name="supplementInfo.expressNo"
                                           th:value="${apply.supplementInfo!=null}? ${apply.supplementInfo.expressNo}"
                                           required="required"/>
                                </div>
                            </div>
                        </div>
                    </div>

                    <h3 class="header smaller lighter blue ">Offer列表</h3>
                    <table id="sample-table-4" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="hide">id</th>
                            <th>审批状态</th>
                            <th>申请结果</th>
                            <th>Offer类型</th>
                            <th>Offer附件</th>
                            <th>回复日期</th>
                            <th>操作人</th>
                            <th>操作日期</th>
                        </tr>
                        </thead>
                    </table>
                    <div id="sample-table-5-Div">
                        <h3 id="nationId" class="header smaller lighter blue ">COE列表</h3>
                        <table id="sample-table-5" class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>学号</th>
                                <th>姓名</th>
                                <th id="name2">coe申请附件</th>
                                <th id="name3">coe结果附件</th>
                                <th>操作人</th>
                                <th>操作日期</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <h3 class="header smaller lighter blue ">补件信息</h3>
                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th class="hide">id</th>
                            <th>寄件类型</th>
                            <th>寄出日期</th>
                            <th>附件</th>
                            <th>操作时间</th>
                            <th>操作人</th>
                        </tr>
                        </thead>
                    </table>
                    <h3 class="header smaller lighter blue ">回访信息</h3>
                    <table id="sample-table-3" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>回访内容</th>
                            <th>回访人姓名</th>
                            <th>回访时间</th>
                        </tr>
                        </thead>
                    </table>
                    <div class="modal-footer">
                        <div id="alert" class="alert alert-success" style="display: none;" role="alert">
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                            <span id="alertText"></span>
                        </div>
                    </div>
                </div>
            </div>

            <div th:include="fragments/bottom::bottom"></div>
        </div>

        <a href="#" id="btn-scroll-up"
           class="btn-scroll-up btn btn-sm btn-inverse"> <i
                class="icon-double-angle-up icon-only bigger-110"></i>
        </a>
    </div>
</div>


<div th:include="fragments/js::js"></div>


<!-- page specific plugin scripts -->
<script th:src="@{/assets/js/jquery.dataTables.min.js}"></script>
<script th:src="@{/assets/js/jquery.dataTables.bootstrap.js}"></script>
<script th:src="@{/assets/js/temp.js}" charset="UTF-8"></script>
<script th:src="@{/My97DatePicker/WdatePicker.js}"></script>
<!--图片查看器-->
<script th:src="@{/assets/js/jquery.form.js}"></script>
<script th:src="@{/assets/js/jquery.colorbox-min.js}"></script>
<script th:src="@{/layer/layer.js}"></script>
<script th:src="@{/business/apply/edit.js}" charset="UTF-8"></script>
<script th:src="@{/assets/js/date-time/moment.min.js}"></script>
<script th:src="@{/js/upload/filePath.js}"></script>
<script type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/
    var applyId = $("#id").val();
    var studentNo = $("#studentNo").val();
    $("#returnBack").click(function () {
        window.history.back(-1);
    })
    $(function () {
        if ($("#copy").val() == "") {
            $(".copy-show").hide();
        }
        if ($("#material").val() == "") {
            $(".material-show").hide();
        }
        var nation = $("#nation").val();
        if (nation == 3) {
            $("#nationId").html("CAS列表");
            $("#name2").html("CAS申请附件");
            $("#name3").html("CAS结果附件");
        } else if (nation == 1) {
            $("#nationId").html("COE列表");
            $("#name2").html("COE申请附件");
            $("#name3").html("COE结果附件");
        } else if (nation == 4) {
            $("#nationId").html("I-20列表");
            $("#name2").html("I-20申请附件");
            $("#name3").html("I-20结果附件");
        } else if (nation == 2) {
            $("#nationId").html("Receipt列表");
            $("#name2").html("Receipt申请附件");
            $("#name3").html("Receipt结果附件");
        } else if (nation == 5) {
            $("#nationId").html("Full Offer列表");
            $("#name2").html("Full Offer申请附件");
            $("#name3").html("Full Offer结果附件");
        } else {
            $("#nationId").hide();
            $("#sample-table-5").hide();
            $("#sample-table-5-Div").hide();

        }
    });

    //回访信息
    jQuery(function ($) {
        var visitCase = 2;
        var businessId = $("#id").val();
        oTable1 = $('#sample-table-3').dataTable({
            "bFilter": false,//是否使用搜索
            "bProcessing": true,
            "bDeferRender": true,//
            "sPaginationType": "bs_normal",//分页样式
            "bRetrieve": true,//是否调用后台
            "bServerSide": true,//是否以后台分页
            "sAjaxSource": "/sale/list/query",//请求路径
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({"name": "studentNo", "value": studentNo});
                aoData.push({"name": "visitCase", "value": visitCase});
                aoData.push({"name": "businessId", "value": businessId});
                $.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": sSource,
                    "data": aoData,
                    "success": fnCallback
                });
            },
            "aaSorting": [[1, "desc"]],
            "aoColumns": [
                {"sClass": "left", "bSortable": false, sWidth: "62%", "mData": "content"},
                {"sClass": "center", "bSortable": false, "mData": "operatorName"},
                {
                    "sClass": "center", "bSortable": false, "mData": "createTime",
                    "mRender": function (data, type, full, meta) {
                        return moment(data).format("YYYY-MM-DD HH:mm:ss");
                    }
                },

            ],
            "oLanguage": {
                "sLengthMenu": "每页 _MENU_条 ",
                "sZeroRecords": "对不起，查询不到任何相关数据",
                "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                "sInfoEmpty": "显示 0 到 0 条，共 0 条记录",
                "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                "sProcessing": "正在加载中...",
                "sSearch": "搜索",
                "sUrl": "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                "oPaginate": {
                    "sFirst": "第一页",
                    "sPrevious": " 上一页 ",
                    "sNext": " 下一页 ",
                    "sLast": " 最后一页 "
                }
            }
            //多语言配置
        });
        $("#query").click(function () {
            oTable1.fnDraw();
        })
    })

    //补件信息
    var oTable1;
    var list_Supplement_Message = [[${list_Supplement_Message}]];
    jQuery(function ($) {
        oTable1 = $('#sample-table-2').dataTable({
            "bFilter": false,//是否使用搜索
            "bPaginate" : false, //是否显示（应用）分页器
            "bInfo" : false, //是否显示页脚信息，DataTables插件左下角显示记录数
            "bProcessing": true,
            "bDeferRender": true,
            "aaSorting": [[0, "desc"]],
            "bSort": true,
            "aaData":list_Supplement_Message,
            "aoColumns": [
//                {"sClass": "center", "bVisible": false, "mData": "id"},
                {
                    "sClass": "center", "bSortable": false, "mData":
                        function (data) {

                            if (data.supplementType == 1) return "首次递交";
                            if (data.supplementType == 2) return "补件";
                            if (data.supplementType == 3) return "邮寄最终成绩单/疫苗表日期";
                            if (data.supplementType == 4) return "邮寄录取包裹";
                        }
                },
                {"sClass": "center", "bSortable": false, "mData": "sendDate_string"},
                {
                    "sClass": "center", "bSortable": false, "mData": function (data) {
                        var supplementAttachments = "";
                            if (data.supplementAttachment == null || data.supplementAttachment == "") {
                            supplementAttachments = "无";
                            } else {
                        var path =  URLencode( data.supplementAttachment);
                            supplementAttachments = '<a href="' +path + '" target="_blank">查看</a>';
                        }
                        return supplementAttachments;
                    }
                },
                {"sClass": "center", "bSortable": false, "mData": "createTime_string"},
                {"sClass": "center", "bSortable": false, "mData": "operatorName"},
            ],
            "oLanguage": {
                "sLengthMenu": "每页 _MENU_条 ",
                "sZeroRecords": "对不起，查询不到任何相关数据",
                "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                "sInfoEmpty": "显示 0 到 0 条，共 0 条记录",
                "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                "sProcessing": "正在加载中...",
                "sSearch": "搜索",
                "sUrl": "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                "oPaginate": {
                    "sFirst": "第一页",
                    "sPrevious": " 上一页 ",
                    "sNext": " 下一页 ",
                    "sLast": " 最后一页 "
                }
            }
            //多语言配置
        });
        $("#query").click(function () {
            oTable1.fnDraw();
        })
    });


    //coe
    var oTable2;
    var list_Coe_Message = [[${list_Coe_Message}]];
    jQuery(function ($) {
        oTable2 = $('#sample-table-5').dataTable({
            "bFilter": false,//是否使用搜索
            "bPaginate" : false, //是否显示（应用）分页器
            "bInfo" : false, //是否显示页脚信息，DataTables插件左下角显示记录数
            "bProcessing": true,
            "bDeferRender": true,
            "aaSorting": [[0, "desc"]],
            "bSort": true,
            "aaData":list_Coe_Message,
            "aoColumns": [
//              {"sClass": "center", "bVisible": false, "mData": "id"},
                {"sClass": "center", "bSortable": false, "mData": "studentNo"},
                {"sClass": "center", "bSortable": false, "mData": "studentName"},
                {
                    "sClass": "center", "bSortable": false, "mData":
                        function (data) {

                            if (data.applyAttachment == null || data.applyAttachment == "") {
                                return "无"
                            }
                            else {
                                var showImg = '<a href="' + data.applyAttachment + '" target="_blank">查看</a>';
                                return showImg;
                            }
                        }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                        function (data) {
                            if (data.attachment == null || data.attachment == "") {
                                return "无"
                            } else {
                                var showImg = '<a href="' + data.attachment + '" target="_blank">查看</a>';
                                return showImg;
                            }
                        }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                        function (data) {
                            if (data.updateTime != null) {
                                return getTimeString_day(new Date(data.updateTime))
                            } else {
                                return "";
                            }
                        }
                },
                {"sClass": "center", "bSortable": false, "mData": "operatorName"},

            ],
            "oLanguage": {
                "sLengthMenu": "每页 _MENU_条 ",
                "sZeroRecords": "对不起，查询不到任何相关数据",
                "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                "sInfoEmpty": "显示 0 到 0 条，共 0 条记录",
                "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                "sProcessing": "正在加载中...",
                "sSearch": "搜索",
                "sUrl": "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                "oPaginate": {
                    "sFirst": "第一页",
                    "sPrevious": " 上一页 ",
                    "sNext": " 下一页 ",
                    "sLast": " 最后一页 "
                }
            }
            //多语言配置
        });

    });


    // offer
    var oTable3;
    var list_Offer_Message = [[${list_Offer_Message}]];
    jQuery(function ($) {
        oTable3 = $('#sample-table-4').dataTable({
            "bFilter": false,//是否使用搜索
            "bPaginate" : false, //是否显示（应用）分页器
            "bInfo" : false, //是否显示页脚信息，DataTables插件左下角显示记录数
            "bProcessing": true,
            "bDeferRender": true,
            "aaSorting": [[0, "desc"]],
            "bSort": true,
            "aaData":list_Offer_Message,
            "aoColumns": [
                {"sClass": "center", "bVisible": false, "mData": "id"},//此列不显示
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.auditStatus == 1) return "已提交";
                        if (data.auditStatus == 2) return "审批中";
                        if (data.auditStatus == 3) return "审批通过";
                        if (data.auditStatus == 4) return "审批不通过";
                        return "--";

                    }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.resultType == 1) return "录取";
                        if (data.resultType == 2) return "拒绝";
                        if (data.resultType == 3) return "满位";
                        if (data.resultType == 4) return "waiting list";
                        if (data.resultType == 5) return "预录取";
                        if (data.resultType == 6) return "其他";
                        if (data.resultType == 7) return "收条";
                        else return "";
                    }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                        if (data.offerType == 1) return "无条件offer";
                        if (data.offerType == 2) return "只有语言条件offer";
                        if (data.offerType == 3) return "只有学术条件offer";
                        if (data.offerType == 4) return "其他条件offer";
                        else return "无";
                    }
                },
                {
                    "sClass": "center", "bSortable": false, "mData":
                    function (data) {
                    var attachment = "";
                    if (data.offerAttachment == null || data.offerAttachment == "") {
                        attachment = "无";
                    } else {
                        var path = URLencode(data.offerAttachment);
                        attachment = '<a href="' + path + '" target="_blank">查看</a>';
                    }
                    return attachment;
                }
                },
                {"sClass": "center", "bSortable": false, "mData": "resultDateString"},
                {"sClass": "center", "bSortable": false, "mData": "operatorName"},
                {"sClass": "center", "bSortable": false, "mData": "createdString"},
            ],
            "oLanguage": {
                "sLengthMenu": "每页 _MENU_条 ",
                "sZeroRecords": "对不起，查询不到任何相关数据",
                "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录 ",
                "sInfoEmpty": "显示 0 到 0 条，共 0 条记录",
                "sInfoFiltered": "数据表中共为 _MAX_ 条记录)",
                "sProcessing": "正在加载中...",
                "sSearch": "搜索",
                "sUrl": "", //多语言配置文件，可将oLanguage的设置放在一个txt文件中，例：Javascript/datatable/dtCH.txt
                "oPaginate": {
                    "sFirst": "第一页",
                    "sPrevious": " 上一页 ",
                    "sNext": " 下一页 ",
                    "sLast": " 最后一页 "
                }
            }
            //多语言配置

        });


        $("#query").click(function () {
            oTable1.fnDraw();
        })

    });

    function getTimeString_day(date) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m >= 10 ? m : '0' + m;
        var d = date.getDate();
        d = d >= 10 ? d : '0' + d;
        return y + '-' + m + '-' + d;
    }

    /*]]>*/
</script>
</body>
</html>
